package com.celeste.mcpserverfeishu.api;

import com.celeste.mcpserverfeishu.dto.FeishuResponse;
import com.celeste.mcpserverfeishu.dto.block.CreateBlockRequest;
import com.celeste.mcpserverfeishu.dto.block.CreateBlockResponse;
import com.celeste.mcpserverfeishu.dto.document.CreateDocumentRequest;
import com.celeste.mcpserverfeishu.dto.document.CreateDocumentResponse;
import com.celeste.mcpserverfeishu.dto.document.GetDocumentContentResponse;
import retrofit2.Call;
import retrofit2.http.*;

/**
 * 飞书API接口定义
 */
public interface FeishuApi {

    /**
     * 创建文档
     *
     * @param authorization 授权信息，格式："Bearer access_token"
     * @param request 创建文档请求
     * @return 创建文档响应
     */
    @POST("/open-apis/docx/v1/documents")
    Call<FeishuResponse<CreateDocumentResponse>> createDocument(
            @Header("Authorization") String authorization,
            @Body CreateDocumentRequest request
    );

    /**
     * 获取文档内容
     *
     * @param authorization 授权信息，格式："Bearer access_token"
     * @param documentId 文档ID
     * @return 文档内容响应
     */
    @GET("/open-apis/docx/v1/documents/{documentId}/raw_content")
    Call<FeishuResponse<GetDocumentContentResponse>> getDocumentContent(
            @Header("Authorization") String authorization,
            @Path("documentId") String documentId
    );

    /**
     * 创建块
     *
     * @param authorization 授权信息，格式："Bearer access_token"
     * @param documentId 文档ID
     * @param blockId 父块ID
     * @param request 创建块请求
     * @return 创建块响应
     */
    @POST("/open-apis/docx/v1/documents/{documentId}/blocks/{blockId}/children")
    Call<FeishuResponse<CreateBlockResponse>> createBlock(
            @Header("Authorization") String authorization,
            @Path("documentId") String documentId,
            @Path("blockId") String blockId,
            @Body CreateBlockRequest request
    );
} 